<template>
    <div ref="scroll">
        <slot></slot>
    </div>
</template>
<script>
import Bscroll from "better-scroll";
// console.log(Bscroll);
export default {
    props:{
        option:{
            type:Object,
            default(){
                return{}
            }
        }
    },
    methods:{
        initScroll(){
            // this.$nextTick(()=>{
                this.$scroll=new Bscroll(this.$refs.scroll,this.option);
                this.$scroll.on("pullingDown",()=>{
                    console.log("ajax");
                    setTimeout(()=>{
                        this.$scroll.finishPullDown();
                    },3000);
                });;
                console.log(this.$scroll)
            // });
        }
    },
    mounted(){
        this.$nextTick(()=>{
            this.initScroll();
        });
    }
}
</script>